import * as types from './types'
const actions = {
  choseTabLine({commit}, msg) {
    commit(types.TABLINE_MSG, msg)
  },
  choseStockIndex({commit}, msg) {
    commit(types.STOCKINDEX_MSG, msg)
  },
  choseTabBar({commit}, msg) {
    commit(types.TABBAR_MSG, msg)
  },
  saveScrollHeight({commit}, height) {
    commit(types.SCROLL_HEIGHT, height)
  },
  ctrlLoading({commit}, loadState) {
    commit(types.SET_LOADING, loadState)
  },
  ctrlError({commit}, errorState) {
    commit(types.SET_ERROR, errorState)
  },
  showLoading({commit}) {
    commit(types.SET_LOADING, true)
    commit(types.SET_ERROR, false)
  },
  hideLoading({commit}) {
    commit(types.SET_LOADING, false)
  },

  showError({commit}) {
    commit(types.SET_ERROR, true)
    commit(types.SET_LOADING, false)
  },
  hideError({commit}) {
    commit(types.SET_ERROR, false)
  },

  changeTransitPrgs({commit}, progress) {
    commit(types.CHANGE_TRANSIT_STATE, progress)
  }
};

export default actions
